<?php
require("../class/connect.php");
require("../class/db_sql.php");
require("../data/dbcache/class.php");
require("../class/user.php");
require("../data/dbcache/MemberLevel.php");
require LoadLang("pub/fun.php");
require LoadLang("pub/set.php");
$link=db_connect();
$empire=new mysqlquery();
$enews=$_POST['enews'];
if(empty($enews))
{
	$enews=$_GET['enews'];
}
//導入文件
if($enews=='AddPl'||$enews=='DoForPl')
{
	include('plfun.php');
}
elseif($enews=='AddVote'||$enews=='AddInfoVote'||$enews=='AddInfoPfen')
{
	include('votefun.php');
}
elseif($enews=='DownSoft'||$enews=='GetSofturl')
{
	include('../class/DownSysFun.php');
}
elseif($enews=='ClearBuycar'||$enews=='AddBuycar'||$enews=='EditBuycar'||$enews=='AddDd'||$enews=='ShopDdToPay')
{
	include('../class/ShopSysFun.php');
}
elseif($enews=='AddGbook')
{
	include('gbookfun.php');
}
elseif($enews=='SendPassword'||$enews=='DoGetPassword'||$enews=='DoActUser')
{
	include('../class/qmemberfun.php');
}
else
{
	include('../class/q_functions.php');
}
if($enews=="AddPl")//增加評論
{
	$username=$_POST['username'];
	$password=$_POST['password'];
	$saytext=$_POST['saytext'];
	$id=$_POST['id'];
	$classid=$_POST['classid'];
	$repid=$_POST['repid'];
	$nomember=$_POST['nomember'];
	$key=$_POST['key'];
	AddPl($username,$password,$nomember,$key,$saytext,$id,$classid,$repid,$_POST);
}
elseif($enews=='DoForPl')//評論意見
{
	DoForPl($_GET);
}
elseif($enews=="login")//登陸
{
	$username=$_POST['username'];
	$password=$_POST['password'];
	$lifetime=$_POST['lifetime'];
	$key=$_POST['key'];
	login1($username,$password,$lifetime,$key,$location);
}
elseif($enews=="register")//註冊
{
	$username=$_POST['username'];
	$password=$_POST['password'];
	$repassword=$_POST['repassword'];
	$email=$_POST['email'];
	register($username,$password,$repassword,$email);
}
elseif($enews=="ChangeSpaceStyle")//選擇空間模板
{
	ChangeSpaceStyle($_GET);
}
elseif($enews=="DoSetSpace")//設置空間信息
{
	DoSetSpace($_POST);
}
elseif($enews=="EditSafeInfo")//修改安全信息
{
	EditSafeInfo($_POST);
}
elseif($enews=="EditInfo")//修改信息
{
	EditInfo($_POST);
}
elseif($enews=="exit")//退出登陸
{
	loginout1($myuserid,$myusername,$myrnd);
}
elseif($enews=='AddVote')//增加投票
{
	$voteid=$_POST['voteid'];
	$vote=$_POST['vote'];
	AddVote($voteid,$vote);
}
elseif($enews=='AddInfoVote')//增加信息投票
{
	$id=$_POST['id'];
	$classid=$_POST['classid'];
	$vote=$_POST['vote'];
	AddInfoVote($classid,$id,$vote);
}
elseif($enews=='AddInfoPfen')//信息評分
{
	if($_GET['id'])
	{
		$add=$_GET;
	}
	else
	{
		$add=$_POST;
	}
	AddInfoPfen($add);
}
elseif($enews=="AddFava")//增加收藏
{
	$cid=$_POST['cid'];
	$id=$_POST['id'];
	$classid=$_POST['classid'];
	$from=$_POST['from'];
	AddFava($id,$classid,$cid,$from);
}
elseif($enews=="DelFava_All")//刪除收藏
{
	$favaid=$_POST['favaid'];
	DelFava_All($favaid);
}
elseif($enews=="DelFava")//刪除收藏
{
	$favaid=$_GET['favaid'];
	DelFava($favaid);
}
elseif($enews=="CardGetFen")//點卡沖值
{
	$username=$_POST['username'];
	$reusername=$_POST['reusername'];
	$card_no=$_POST['card_no'];
	$password=$_POST['password'];
	CardGetFen($username,$reusername,$card_no,$password);
}
elseif($enews=="DownSoft")//下載軟件
{
	$classid=$_GET['classid'];
	$id=$_GET['id'];
	$pathid=$_GET['pathid'];
	$p=$_GET['p'];
	$pass=$_GET['pass'];
	DownSoft($classid,$id,$pathid,$p,$pass);
}
elseif($enews=="GetSofturl")//取得軟件地址
{
	$classid=$_GET['classid'];
	$id=$_GET[id];
	$pathid=$_GET[pathid];
	$p=$_GET[p];
	$pass=$_GET['pass'];
	$onlinetime=$_GET['onlinetime'];
	$onlinepass=$_GET['onlinepass'];
	$movtime=20;
	GetSofturl($classid,$id,$pathid,$p,$pass,$onlinetime,$onlinepass);
}
elseif($enews=="ClearBuycar")//清空購物車
{
	ClearBuycar();
}
elseif($enews=="AddBuycar")//加入購物車
{
	$classid=$_GET['classid'];
	$id=$_GET['id'];
	AddBuycar($classid,$id);
}
elseif($enews=="EditBuycar")//修改購物車
{
	EditBuycar($_POST);
}
elseif($enews=="AddDd")//增加定單
{
	AddDd($_POST);
}
elseif($enews=="ShopDdToPay")//未付款的繼續支付
{
	$ddid=$_GET['ddid'];
	ShopDdToPay($ddid);
}
elseif($enews=="AddFavaClass")//增加收藏夾分類
{
	AddFavaClass($_POST);
}
elseif($enews=="EditFavaClass")//修改收藏夾分類
{
	EditFavaClass($_POST);
}
elseif($enews=="DelFavaClass")//刪除收藏夾分類
{
	$cid=$_GET['cid'];
	$doing=$_GET['doing'];
	DelFavaClass($cid,$doing);
}
elseif($enews=="MoveFava_All")//移動收藏夾
{
	$favaid=$_POST['favaid'];
	$cid=$_POST['cid'];
	MoveFava_All($favaid,$cid);
}
elseif($enews=="AddGbook")//增加留言
{
	AddGbook($_POST);
}
elseif($enews=="AddFeedback")//增加反饋
{
	$doetran=1;
	AddFeedback($_POST);
}
elseif($enews=="AddError")//增加錯誤報告
{
	AddError($_POST);
}
elseif($enews=="AddMsg")//發送短信息
{
	AddMsg($_POST);
}
elseif($enews=="AddOutMsg")//保存發件箱
{
	AddOutMsg($_POST);
}
elseif($enews=="DelMsg")//刪除短信息
{
	DelMsg($_GET['mid'],$_GET['out']);
}
elseif($enews=="DelMsg_all")//批量刪除短信息
{
	DelMsg_all($_POST['mid'],$_POST['out']);
}
elseif($enews=="AddFriend")//添加好友
{
	AddFriend($_POST);
}
elseif($enews=="EditFriend")//修改好友
{
	EditFriend($_POST);
}
elseif($enews=="DelFriend")//刪除好友
{
	DelFriend($_GET);
}
elseif($enews=='SendPassword')//發送取回密碼郵件
{
	SendGetPasswordEmail($_POST);
}
elseif($enews=='DoGetPassword')//重設密碼
{
	DoGetPassword($_POST);
}
elseif($enews=='DoActUser')//激活帳號
{
	DoActUser($_GET);
}
else
{printerror("ErrorUrl","history.go(-1)",1);}
db_close();
$empire=null;
?>
